<%@page import="custom.Question"%>
<%@page import="custom.Quiz"%>
<%@page import="custom.Performances"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Edit Quiz</title>
</head>
<body>
	<%@ include file="header.jsp" %>
	<center><div style="width: 800px;" align="left">
		<div style="font-style: italic; font-weight: 800;">Edit Quiz</div>
			<%
				ArrayList<Question> list = (ArrayList<Question>) session.getAttribute("questions" );
				session.getAttribute("quizName");
				session.getAttribute("quizDesc");
				
				for(int i=0; i<=list.size(); i++){%>
					<p>	
						<div style="display: inline;">
							<input type="button" value="add 'QUESTION-RESPONSE'" ONCLICK="window.location.href='newQuestion.jsp?pos=<%=i%>&type=<%=1%>'" />
							<input type="button" value="add 'FILLIN THE BLANK'" ONCLICK="window.location.href='newQuestion.jsp?pos=<%=i%>&type=<%=2%>'" />
							<input type="button" value="add 'MULTIPLE CHOIS'" ONCLICK="window.location.href='newQuestion.jsp?pos=<%=i%>&type=<%=3%>'" />
							<input type="button" value="add 'PICTURE-RESPONCE'" ONCLICK="window.location.href='newQuestion.jsp?pos=<%=i%>&type=<%=4%>'" />
						</div>
					<%	if(i==list.size()){
							out.print("</p>");
							break;
						}%>
						<p>#<%=i+1%></p>
						<form action="RemoveQuestionServlet" method="post">
							<input type="hidden" name="i" value="<%=i %>" />
							<input type="submit" value="remove"/>
						</form>
						<p><%=list.get(i).getQuestionHtmlB() %></p>
						<p><%=list.get(i).getAnswerHtml() %></p>
					</p>
			<%	}%>
			<form action="CompleteQuizCreationServlet" method="post"><input type="submit" value="complete"/></form>
	</div></center>
</body>
</html>